import Vue from 'vue'

// 默认设备信息结构
const deviceInfo = {
	height: 0,
	model: "",
	platform: "",
	screenHeight: 0,
	top: 0,
	windowBottom: 0,
	windowHeight: 0,
}

export default {
	namespaced: true,
	state: {
		deviceInfo,
	},
	mutations: {
		setDeviceInfo(state, deviceInfo) {
			state.deviceInfo = Vue.prototype.$u.deepMerge(state.device, deviceInfo)
		},
	},
	actions: {
		// 获取程序运行设备信息
		setDeviceInfo({
			commit,
			state
		}, data) {
			commit('setDeviceInfo', data)
		},
	},
	getters: {

	},
}